<?php

/**
 * Boleta form base class.
 *
 * @method Boleta getObject() Returns the current form's model object
 *
 * @package    aeropostal
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseBoletaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'proveedor'         => new sfWidgetFormInputHidden(),
      'fecha'             => new sfWidgetFormDate(),
      'numBoleta'         => new sfWidgetFormInputHidden(),
      'factura'           => new sfWidgetFormPropelChoice(array('model' => 'Factura', 'add_empty' => true)),
      'vuelo'             => new sfWidgetFormPropelChoice(array('model' => 'Vuelo', 'add_empty' => false)),
      'estacionSum'       => new sfWidgetFormPropelChoice(array('model' => 'Estacion', 'add_empty' => false)),
      'compania'          => new sfWidgetFormInputText(),
      'aeronave'          => new sfWidgetFormPropelChoice(array('model' => 'Aeronave', 'add_empty' => false)),
      'uMedida'           => new sfWidgetFormPropelChoice(array('model' => 'Unidmedida', 'add_empty' => false)),
      'tipoComb'          => new sfWidgetFormPropelChoice(array('model' => 'Tipocomb', 'add_empty' => false)),
      'lecturaI'          => new sfWidgetFormInputText(),
      'lecturaF'          => new sfWidgetFormInputText(),
      'total'             => new sfWidgetFormInputText(),
      'cantNacional'      => new sfWidgetFormInputText(),
      'cantInternacional' => new sfWidgetFormInputText(),
      'horaI'             => new sfWidgetFormTime(),
      'horaF'             => new sfWidgetFormTime(),
      'horaTotal'         => new sfWidgetFormTime(),
      'estatus'           => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'proveedor'         => new sfValidatorPropelChoice(array('model' => 'Proveedor', 'column' => 'rif', 'required' => false)),
      'fecha'             => new sfValidatorDate(),
      'numBoleta'         => new sfValidatorChoice(array('choices' => array($this->getObject()->getNumboleta()), 'empty_value' => $this->getObject()->getNumboleta(), 'required' => false)),
      'factura'           => new sfValidatorPropelChoice(array('model' => 'Factura', 'column' => 'numero', 'required' => false)),
      'vuelo'             => new sfValidatorPropelChoice(array('model' => 'Vuelo', 'column' => 'numVuelo')),
      'estacionSum'       => new sfValidatorPropelChoice(array('model' => 'Estacion', 'column' => 'codigo')),
      'compania'          => new sfValidatorString(array('max_length' => 255)),
      'aeronave'          => new sfValidatorPropelChoice(array('model' => 'Aeronave', 'column' => 'serial')),
      'uMedida'           => new sfValidatorPropelChoice(array('model' => 'Unidmedida', 'column' => 'simbolo')),
      'tipoComb'          => new sfValidatorPropelChoice(array('model' => 'Tipocomb', 'column' => 'nombre')),
      'lecturaI'          => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'lecturaF'          => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'total'             => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'cantNacional'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'cantInternacional' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'horaI'             => new sfValidatorTime(),
      'horaF'             => new sfValidatorTime(),
      'horaTotal'         => new sfValidatorTime(),
      'estatus'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('boleta[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Boleta';
  }


}
